<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    function Box(){
		this.username = "zhangsan";
    }
	Box.prototype.age = 100;
	const obj = new Box();
	const obj2 = new Box();
	// 原型对象特点是共享
	// console.log(obj.username,obj2.username);// zhangsan zhangsan
    // obj.username = "lisi";
	// console.log(obj.username,obj2.username);// lisi zhangsan

	console.log(obj.__proto__ === Box.prototype);
	console.log(obj2.__proto__ === Box.prototype);
	console.log(obj.__proto__ === obj2.__proto__);// true
    // obj.__proto__.age = 300;
    obj.age = 300;
	console.log(obj,obj2,obj.age,obj.__proto__.age,obj2.age);// 300 100

</script>
</html>